U.S. Ser. No. 10/022,104 discloses a process control system 801 (FIG. 8). In broad terms, process control system 801 works by making records of processes that are being controlled in a table in database system 825 and using predefined queries that are stored in a table database system 825 to repeatedly query the table and perform administrative activities that are predefined for the query on the result set of records returned by the query. The records of the processes are often termed in the following as “PR records”. The repeated queries are executed automatically by system 801. The predefined and automatically executed queries are termed herein administrative queries. An administrative activity is made up of a number of predefined administrative actions, and when the activity is performed, system 801 executes its actions. The activities to be performed by an administrative query, as well as an activity's actions, are also defined by entries in tables in the database system, and log tables in the database system determine the state of a process record returned by the administrative query with regard to that execution of the administrative query. When an execution of a query returns a process record, system 801 uses the state information to determine what activity is to be performed with regard to the process record.
Current schedule table 823 in memory 809 contains an entry for each administrative query which system 801 is repeatedly executing; the entry for the query in table 823 includes the time for the next execution of the query by system 801. Current query and processing plans table 824 is an optimization; when system 801 begins execution of an administrative query, it reads the information needed to execute the administrative query and perform any activities associated with it from the records in database system 825 that define the query and the activities and stores the information in table 824, where it is quickly and easily available to system 801 for use during the execution of the administrative query. Tables 823 and 824 are updated whenever system 801 checks database system 825 and finds that configuration tables have changed; such update of table 823 and 824 is then performed based on the configuration information fetched from database system 825.
As would be expected from the above overview, database system 825 includes PR tables 827, which are the tables that contain the records for the processes, PR activity tables 835, containing records that define and log the activities, action tables 857, whose records define the actions that make up an activity, and administrative query tables 845, which define the administrative queries that system 801 may execute on the PR tables 827. The definition of an administrative query includes the query, one or more activities to be performed, and the intervals at which the administrative query is to be made. Log tables 871 keep track of the state of a process with regard to a query and also chart trends in the processes being controlled. Log tables 871 and program sequence 855 together permit the activity that is performed when a query finds a PR record to be selected according to the state of the PR record with regard to the current execution of the administrative query.
To give a concrete example, one type of process that can be controlled by system 801 is a customer complaint. The exemplary process for dealing with a customer complaint is to assign it to a customer complaint specialist. The customer complaint specialist is to investigate the complaint and reply to the customer within a set time period. If the reply is not timely, the complaint is escalated to the customer complaint specialist's supervisor, again with a time limit for the supervisor to deal with the problem. The activity that corresponds to the escalation is the dispatch of an email message to the supervisor. In system 801, when the complaint arrives, a PR record for the complaint is made in a table in PR tables 827. When the complaint specialist replies to the customer, the PR record is altered to indicate that the complaint specialist has replied and the time of the reply. System 801 periodically runs a query contained in administrative query tables 845 which queries PR table 833 for PR records that indicate that the complaint specialist has not timely replied. The query further specifies that when the complaint specialist has not timely replied, the activity to be performed is to escalate the complaint by sending email to the supervisor. When system 801 finds such a record, it performs the specified activity, as defined by records in PR activity tables 835 and in action tables 857. System 801 records the time at which the query was run, the fact that the PR record was found and the activity performed in log tables 871. One function of log tables 871 is to record the state of a process with regard to a given PR record and a given execution of a query and to permit different executions of the given query to result in different activities being performed for the given PR record, depending on the state of the process. For instance, once the escalation is recorded in the log tables with regard to the query and the PR record, further executions of the query will not result in repeated escalation activities. In the terminology that is used in the following, once the query has resulted in the performance of the escalation activity for the given PR record, the given PR record is in a state of Persistent Conditions with regard to the query and because the given PR record is in the state of Persistent Conditions, the escalation activity is not repeated.
In process control system 801, administrative activities have the following limitations:                the performance of an administrative activity cannot include the performance of another administrative activity.        an administrative activity's administrative actions can only execute actions on PR records belonging to an administrative query's result set.        The actions are limited to setting fields in PR records belonging to an administrative query's result set.There are, however, many situations where it would be useful for the performance of an administrative activity to include the performance of another administrative activity, where it would be useful to execute actions on other PR records and to execute actions that did things other than set fields in PR records. By way of example a hypothetical corporation is using process control system 801 to track customer complaints. The complaints have associated child records known as investigation records. When all of the investigations represented by the child records have been closed, the complaint should be closed. In system 801, an administrative activity that is being performed on a result set set of child records cannot do this, since its actions are limited to the result set of child records. Because the administrative activity cannot do this, The user of system 801 is required to close the complaint manually upon seeing that all Investigations are closed.        
The limitations on administrative activities in System 801 also make it impossible to write an administrative activity that responds to a result set that indicates a problem by executing another administrative activity which obtains a result set that indicates the extent of the problem and performs an action based on the extent of the problem. It is therefore an object of the present invention to overcome the above described limitations of administrative activities.